// pages/working/working.js
const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    teacher:[]
  },
  doEvaluate:function (params) {
    var teacherCourse = params.currentTarget.dataset.teachercourse;
    var teacherName = params.currentTarget.dataset.teachername;
    var teacherEvaluateFlag = params.currentTarget.dataset.teacherevaluateflag;
    var teacherId = params.currentTarget.dataset.teacherid;
    console.log(params)
    console.log(teacherName+teacherCourse+teacherId)
    console.log("评教")
    wx.navigateTo({
      url: '../content2/content?teacherName='+teacherName+'&teacherCourse='+teacherCourse+'&teacherId='+teacherId+'&teacherEvaluateFlag='+teacherEvaluateFlag
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    var url = app.globalData.url;
    var studentId = app.globalData.studentId;
    var that = this;
    wx.request({
      url: url+'/getTeacher', 
      data: {
        studentId: studentId
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      success (res) {
        console.log(res.data)
        that.setData({
          teacher:res.data
        })
      }
    })

    console.log(that.data.teacher)
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})